$(function(){



    //交易所公告
    var notice = new Vue({
        el: '#block-information',
        data:{
            pageSize:10,
            currPage: 1,
            noticeBlock: [],
        },
        methods:{
            goNoticeText: function(event){
                var id = event.currentTarget.getAttribute('value');
                window.open('bourseNoticeText.html?id='+id);
            },
            //时间差
            getTimeChar:function(oldTime){
                var date =  new Date();
                var currTime = date.getTime();
                var t = currTime - oldTime;
                var timeType = [{name:'分前',value:60000},{name:'小时前',value: 3600000},{name:'天前',value:86400000}, ];
                for(var i=timeType.length-1; i>=0; i--){
                    if( t > timeType[i].value){
                        return  Math.floor(t/timeType[i].value)+timeType[i].name;
                    }
                }
            },
            loadData:function(){
                var sw = true;
                if(getScrollTop() + window.innerHeight >= document.body.offsetHeight-50) {
                    $('.loadData').removeClass('hidden');
                    var _this = this;
                    if(sw==true){
                        sw = false;
                        //获取动态资讯
                        this.currPage++;
                        var data = {
                            pageSize: this.pageSize, //	每页条数	否	9	Number	默认10，最大50
                            pageNum: this.currPage, //	第几页	否	9	Number	默认1
                            element: this,
                        };
                        getBourList(data);
                    }
                }
            }, //结束 loadData
        },
        mounted:function(){
            this.$nextTick(function(){
                // cancelLoad([quickInfo.loadData,siftInfo.loadData,twitterInfo.loadData,blogInfo.loadData,skillInfo.loadData]);
                addLoad(this.loadData);

                // 查询交易所公告
                var data = {
                    pageSize: this.pageSize, //	每页条数	否	9	Number	默认10，最大50
                    pageNum: this.currPage, //	第几页	否	9	Number	默认1
                    element: this,
                };
                getBourList(data);

            });
        }
    });
    //右侧
    var n = new Vue({
        el: '#news-information',
        data:{
            downImg:'image/xiala.png',
            //24H涨跌幅
            proBlock:[ ],
        },
        components:{
            // 'notice-content': noticeFullComponent, //交易所公告
            'up-down-content': upDownFullComponent, //24H涨跌榜
            // 'hot-content':hotFullComponent,  //热门资讯
        },
        methods:{ },
    });

});